package com.wk1un2.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wk1un2.entity.ProductCategory;
import com.wk1un2.mapper.ProductCategoryMapper;
import com.wk1un2.service.ProductCategoryService;

/**
 * 业务接口的实现类
 * 
 * @author Administrator
 *
 */
@Service // 扫描
public class ProductCategoryServiceImpl implements ProductCategoryService {

	@Autowired
	private ProductCategoryMapper ProductCategoryMapper;// 自动注入mapper

	@Override
	public List<Map<String, Object>> getAll(int page, int limit, String pcat_name) {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.getAll(page, limit, pcat_name);
	}

	@Override
	public Integer count() {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.count();
	}

	@Override
	public Integer add(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.add(map);
	}

	@Override
	public Integer update(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.update(map);
	}

	@Override
	public Integer delete(int pcat_id) {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.delete(pcat_id);
	}

	@Override
	public List<Map<String, Object>> getCategory(String pcat_name) {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.getCategory(pcat_name);
	}

	@Override
	public Integer getProCount(int pcat_id) {
		// TODO Auto-generated method stub
		return ProductCategoryMapper.getProCount(pcat_id);
	}

}
